package simple01.factory;

import simple01.fruit.Apple;
import simple01.fruit.Banana;
import simple01.fruit.Fruit;
import simple01.fruit.Orange;

public class FruitFactory {
    public static final int BANANA_TYPE =1;
    public static final int ORANGE_TYPE =2;
    public static final int APPLE_TYPE =3;
    public static Fruit getFruit(int type){
        switch (type){
            case BANANA_TYPE:
                return new Banana();
            case ORANGE_TYPE:
                return new Orange();
            case APPLE_TYPE:
                return new Apple();
        }
        return  null;
    }
    public static Fruit getApple(){
        return new Apple();
    }

    public static Fruit getOrange(){
        return new Orange();
    }
    public static Fruit getBanana(){
        return new Banana();
    }

}
